<script setup>
import Node from "./base/Node.vue";
import nodeMixin from "../NodeMixin";

const props = defineProps({
  ...nodeMixin.props
});

const emit = defineEmits(["select", "insertNode"]);
//节点定义json对象
const _value = defineModel();
const showErr = ref(false);
const errInfo = ref(null);

function validate(err) {
  const prop = _value.value.props;
  showErr.value = false;
}

const handleSelect = () => {
  emit("select", { node: _value.value });
};

defineExpose({ validate });
</script>

<template>
  <node
    v-model="_value"
    :readonly="readonly"
    :show-close="false"
    :show-error="showErr"
    :index="index"
    type="Start"
    @select="handleSelect"
    :flowHistory="flowHistory"
    :error-info="errInfo"
    @insert-node="type => emit('insertNode', props.branch, index, type)"
    :header-color="props.headerColor"
    header-icon="video-play"
    content="从本节点开始"
  />
</template>

<style scoped></style>
